﻿#region License
/* Copyright (C) 2009 Tim Coulter
 * 
 * This file is part of ExtremeML.
 * 
 * ExtremeML is free software: you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation either version
 * 2 of the License, or (at your option) any later version.
 * 
 * ExtremeML is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
 * the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses/.
*/
#endregion

using System;
using System.Collections.Generic;

namespace ExtremeML.Builder
{
	/// <summary>
	/// Exposes the design parameters for a generated concrete implementation of ElementWrapperCollection. 
	/// </summary>
	public class ElementWrapperCollectionModel : WrapperModelBase
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="ElementWrapperCollectionModel"/> class.
		/// </summary>
		/// <param name="wrappedType">The wrapped <see cref="Type"/>.</param>
		/// <param name="target">A <see cref="WrapperTypeInfo"/> that specifies the form of the generated class.</param>
		/// <param name="items">The <see cref="WrapperTypeInfo"/> of the contained wrapper class.</param>
		public ElementWrapperCollectionModel(
			Type wrappedType,
			WrapperTypeInfo target,
			WrapperTypeInfo items)
			: base(wrappedType, target)
		{
			Items = items;
		}

		/// <summary>
		/// Gets the <see cref="WrapperTypeInfo"/> of the contained wrapper class.
		/// </summary>
		public WrapperTypeInfo Items { get; private set; }

		/// <summary>
		/// Returns the set of <see cref="WrapperPropertyMapping"/> for this wrapper type.
		/// </summary>
		protected override IEnumerable<WrapperPropertyMapping> GetProperties()
		{
			// Element wrapper collections do not map any properties to their wrapped instance.
			yield break;
		}
	}
}
